<template>
  <view>
    <roc-template
      ref="rocTemplate"
      v-if="Object.keys(urlQuery).length"
      :urlQuery="urlQuery"
      :scrollTop="scrollTop"
    ></roc-template>
  </view>
</template>

<script>
export default {
  data() {
    return {
      urlQuery: {},
      scrollTop: 0
    };
  },
  onLoad(option) {
    this.urlQuery = option;
  },
  onPageScroll(e) {
    this.scrollTop = e.scrollTop;
  },
  async onPullDownRefresh() {
    this.$refs['rocTemplate'].queryForm.pageNo = 1;
    await this.$refs['rocTemplate'].fetchData();
    uni.stopPullDownRefresh();
  }
};
</script>
